package com.project.myproject;

import com.alibaba.fastjson.JSONObject;

import java.io.Serializable;

/**
 * <br>
 * 标题: 最外层入参基类<br>
 * 描述: 指对外围系统的接口层和对页面的组合服务层<br>
 */
public class ReqInfoBO implements Serializable {

    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = 7157804200654572756L;

    /**
     * 流水号
     */
    private String reqNo;
    private Long orgIdReq;
    private SysUserInfo sysUserInfo;
    private String sysUserInfoJson;
    private AdminUserInfo adminUserInfo;

    /**
     * 萤石token
     */
    private String accessToken;

    ////////////////////////////////////////////
    //客户端类型 （1web 2ios 3android 4pc）
    private Integer clientType;
    //终端系统版本
    private String osVersion;
    //客户端版本
    private String clientVersion;
    //网络类型
    private String netType;

    //版本(新）
    private String ver;


    /**
     * 流水号
     */
    public String getReqNo() {
        return reqNo;
    }

    public void setReqNo(String reqNo) {
        this.reqNo = reqNo;
    }

    public Long getOrgIdReq() {
        return orgIdReq;
    }

    public void setOrgIdReq(Long orgIdReq) {
        this.orgIdReq = orgIdReq;
    }

    public Integer getClientType() {
        return clientType == null ? 1 : clientType;
    }

    public void setClientType(Integer clientType) {
        this.clientType = clientType;
    }

    public String getOsVersion() {
        return osVersion;
    }

    public void setOsVersion(String osVersion) {
        this.osVersion = osVersion;
    }

    public String getClientVersion() {
        return clientVersion;
    }

    public void setClientVersion(String clientVersion) {
        this.clientVersion = clientVersion;
    }

    public String getNetType() {
        return netType;
    }

    public void setNetType(String netType) {
        this.netType = netType;
    }

    public SysUserInfo getSysUserInfo() {
        if (sysUserInfo != null) {
            return sysUserInfo;
        } else if (sysUserInfoJson != null) {
            sysUserInfo = (SysUserInfo) JSONObject.parse(sysUserInfoJson);
//            sysUserInfo = new Gson().fromJson(sysUserInfoJson, SysUserInfo.class);
            return sysUserInfo;
        } else {
            return sysUserInfo;
        }
    }

    public void setSysUserInfo(SysUserInfo sysUserInfo) {
        this.sysUserInfo = sysUserInfo;
    }

    public String getAccessToken() {
        return accessToken;
    }

    public void setAccessToken(String accessToken) {
        this.accessToken = accessToken;
    }

    public String getVer() {
        return ver;
    }

    public void setVer(String ver) {
        this.ver = ver;
    }

    public String getSysUserInfoJson() {
        return sysUserInfoJson;
    }

    public void setSysUserInfoJson(String sysUserInfoJson) {
        this.sysUserInfoJson = sysUserInfoJson;
    }

    public AdminUserInfo getAdminUserInfo() {
        return adminUserInfo;
    }

    public void setAdminUserInfo(AdminUserInfo adminUserInfo) {
        this.adminUserInfo = adminUserInfo;
    }


    @Override
    public String toString() {
        return "ReqInfoBO [reqNo=" + reqNo + ", orgId=" + orgIdReq + "]";
    }
}
